<template>
  <div class="order_list">
      <my-header>
          <template #left>
             <van-icon name="arrow-left" @click="$router.back()"/>
          </template>
          <template #center>
             我的订单
          </template>
      </my-header>
      <ul>
          <!-- 当v-for 循环对象的时候 item 是属性值 index 属性名 -->
          <li v-for="(item,index) in list" :key="index">
              <p>查看详情</p>
               <ol>
                   <li v-for="(n,i) in item" :key="i">
                       <img :src="n.pic" alt="">
                   </li>
               </ol>
          </li>
      </ul>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import myHeader from '../../components/myHeader.vue';
import { getOrder } from '../../api/secendPage/index';
export default {
  components: { myHeader },
  setup() {
    const data = reactive({
      list: [],
      obj:{name:'张三',age:14 }
    })
    getOrder({token:localStorage.getItem('token')}).then(res => {
        data.list = res.data.goodsMap;
        // console.log(data.list.1326132);
    })
    return{
      ...toRefs(data)
    }
  },
};
</script>
<style lang="scss" scoped>
.order_list{
  height: 100%;
  img{
    width: 80px;
    height: 80px;
  }
}
</style>